﻿using System;
using Sencha.Serialization;

namespace Sencha.Direct.Api
{
	public sealed class ControllerDescriptionSerializer : TypeSerializer<ControllerDescription>
	{

		public override ControllerDescription Deserialize(IJsonReader reader)
		{
			throw new NotSupportedException();
		}

		public override void Serialize(IJsonWriter writer, ControllerDescription value)
		{
			if (writer == null)
				throw new ArgumentNullException("writer");

			if (value == null)
			{
				writer.WriteNull();
				return;
			}

			value.SerializeTo(writer);
		}
	}
}
